{extend name="public:layout" /}
{block name="title"}添加{$moudleName}{/block}
{block name="head"}{/block}
{block name="body"}
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li>
                    <i class="fa fa-hand-o-right"></i>
                    <a href="{:url('index',['mid'=>$Request.param.mid,'cid'=>$Request.param.cid])}">{$moudleName}列表</a>
                </li>
                <li class="active">修改{$moudleName}</li>
            </ol>
        </div>
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">订单客户</label>
                    <div class="col-sm-10">
                        <input type="hidden" name="title" value="{$info.title}" datatype="*" />
                        <input type="text" name="btype_id" id="select-client" placeholder="请输入客户名称检索" data-init="{$info.btype_id}" style="width:100%;" />
                        <script>
                            In('selectpage',function(){
                                $('#select-client').selectPage({
                                    keyField:'aid',
                                    showField:'title',
                                    multiple:false,
                                    pagination:true,
                                    dbTable:'car_btype',
                                    data:'/plus/ajax/selectpage',
                                    andOr:'OR',
                                    params : function(){return {'searchField':'company','btype_type':'0'}},
                                    eAjaxSuccess : function(data){
                                        if(data.totalRow>0){
                                            return data;
                                        }else{
                                            return false;
                                        }
                                    },
                                    eSelect:function (data) {
                                        $("input[name='title']").val(data.company+':'+data.title + '(' + data.btype_phone + ')');
                                    },
                                    formatItem : function(data){
                                        return data.company+':'+data.title + '(' + data.btype_phone + ')';
                                    }
                                });
                            })
                        </script>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">计划出车</label>
                    <div class="col-sm-4">
                        <input class="form-control laydatetime" type="text" placeholder="" name="begin_time" value="{$info.begin_time}" />
                    </div>
                    <label class="col-sm-2 control-label Validform_label">计划收车</label>
                    <div class="col-sm-4">
                        <input class="form-control laydatetime" type="text" placeholder="" name="end_time" value="{$info.end_time}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">订单费用</label>
                    <div class="col-sm-4">
                        <input class="form-control" type="text" placeholder="" name="order_money" value="{$info.order_money}"  />
                    </div>
                    <label class="col-sm-2 control-label Validform_label">用车数量</label>
                    <div class="col-sm-4">
                        <input class="form-control" type="text" placeholder="" name="use_car_num" value="{$info.use_car_num}" datatype="*,s" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">备注</label>
                    <div class="col-sm-10">
                        <textarea class="form-control" rows="3" name="remark" >{$info['remark']}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-10 col-sm-offset-2">
                        <button class="btn btn-primary" id="btnSub" type="button">保存</button>
                        <a href="{:url('index',['mid'=>$Request.param.mid])}" class="btn btn-white">取消</a>
                        <span id="validError"></span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        iCheck();
        formatDate();
        ajaxSubForm('#btnSub');
    });
</script>
{/block}